<!DOCTYPE html>

<html>

    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="../../dist/avalon.js"></script>
    </head>
    <body>
        <div ms-controller='test'>
            <h1>循环生成组件必须加$id</h1>
            <ul>
                <li ms-for="el in [1,2,3]">
                <ms-button ms-widget="{buttonText:'这是属性'+el,id:'d'+el}"></ms-button>
                </li>
            </ul>
        </div>
        <script>

            avalon.component('ms-button', {
                template: '<button type="button"><span><slot/></span></button>',
                defaults: {
                    buttonText: "button"
                },
                soleSlot: 'buttonText'
            })

            var vm = avalon.define({
                $id: 'test',
                btn: 'XXX'
            })

        </script>
    </body>

</html>